package com.mi.system.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mi.system.dto.query.DictItemQueryDTO;
import com.mi.system.dto.request.DictItemRequestDTO;
import com.mi.system.entity.DictItem;
import com.mi.system.vo.DictItemBriefVO;
import com.mi.system.vo.DictItemVO;

import java.util.List;

/**
 * Dict item service
 *
 * @author jin_huaquan
 * @version 1.0
 * @date 2021/11/1 13:54
 */
public interface DictItemService extends IService<DictItem> {

    /**
     * list dict item
     *
     * @param page  page info
     * @param query query params
     * @return dict item list
     */
    Page<DictItemVO> listDictItem(Page page, DictItemQueryDTO query);

    /**
     * list dict item
     *
     * @param type dict type
     * @return dict item list
     */
    List<DictItemBriefVO> listDictItem(String type);

    /**
     * save dict item
     *
     * @param request dict item info
     * @return result
     */
    boolean saveDictItem(DictItemRequestDTO request);

    /**
     * update dict item
     *
     * @param id      dict item id
     * @param request dict item info
     * @return result
     */
    boolean updateDictItem(Long id, DictItemRequestDTO request);

    /**
     * remove dict item
     *
     * @param id dict item id
     * @return result
     */
    DictItem removeDictItem(Long id);
}

